<template>
  <a-modal title="详情" :visible="dialogVisible" :footer="null" @cancel="cancel">
    <div>
      <a-row>
        <a-col :span="3">姓名：</a-col>
        <a-col :span="21">{{ form.name }}</a-col>
      </a-row>
      <a-row>
        <a-col :span="3">年龄：</a-col>
        <a-col :span="21">{{ form.age }}</a-col>
      </a-row>
      <a-row>
        <a-col :span="3">性别：</a-col>
        <a-col :span="21">{{ formatGender(form.gender) }}</a-col>
      </a-row>
    </div>
  </a-modal>
</template>

<script>
const genderOptions = [
  {
    label: '男',
    value: '0'
  },
  {
    label: '女',
    value: '1'
  }
]
export default {
  name: 'WtDetails',
  components: {},
  props: {},
  data() {
    return {
      dialogVisible: false,
      form: {}
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    init(data) {
      this.dialogVisible = true
      this.form = JSON.parse(JSON.stringify(data))
    },
    cancel() {
      this.dialogVisible = false
    },
    formatGender(val) {
      return genderOptions.find(item => item.value === val)?.label
    }
  },
  filters: {}
}
</script>
<style scoped lang="less"></style>
